#pragma once
#include "UGCtrl.h"
#include "OptionStrikes.h"

// COptionGrid
class CMainOrderPanel;
class COptionGrid : public CUGCtrl
{
	DECLARE_DYNAMIC(COptionGrid)

public:
	COptionGrid();
	virtual ~COptionGrid();
	CMainOrderPanel* MainWnd() const { return m_pMainWnd; }
	void MainWnd(CMainOrderPanel* val) { m_pMainWnd = val; }
	// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(COrderStateGrid)
	//***** Over-ridable Notify Functions *****
	virtual void OnSetup();
	virtual void OnLClicked(int col, long row, int updn, RECT *rect, POINT *point, int processed);
	virtual void OnRClicked(int col, long row, int updn, RECT *rect, POINT *point, int processed);
	virtual void OnDClicked(int col, long row, RECT *rect, POINT *point, BOOL processed);
	//}}AFX_VIRTUAL

	CFont m_font1;
	CFont m_font2;
	int m_MaxRow;
	int m_RowHeight;

	void SetOptionMonth(OptionMonth& a_Month);

	int oldATMRow;
	void ShowATM(double a_CurVal, long a_Row);
	int  FindRowOfCurVal(double a_CurVal);
	void ClearStrikes();
	void SetTopVisibleRow(double a_ATM);
private:
	CMainOrderPanel* m_pMainWnd;
	int oldSelectedCol;
	int oldSelectedRow;

protected:
	DECLARE_MESSAGE_MAP()
};


